package com.example.bootdemo.repository;

import com.example.bootdemo.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface TblUserRepository extends JpaRepository<User,Long> {

    User findUserByUsername(String username);

    @Modifying
    @Query(value="delete from tbl_user where username=?1",nativeQuery = true)
    int deleteUserByUsername(String username);

}
